package com.diankangwo.factory.dao;

import com.diankangwo.factory.entity.TdDistribution;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 佣金明细Mapper
 */
@Mapper
@Repository
public interface TdDistributionMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(TdDistribution record);

    int insertSelective(TdDistribution record);

    TdDistribution selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TdDistribution record);

    int updateByPrimaryKey(TdDistribution record);

    /**
     * 根据条件查询佣金明细列表
     * @param map
     * @return
     */
    List<TdDistribution> queryList(Map<String,Object> map);
    List<TdDistribution> queryList2(Map<String,Object> map);

    /**
     * 获取总数
     */
    int queryTotal(Map<String,Object> map);
    int queryTotal2(Map<String,Object> map);

    /**
     * 根据抽佣用户查询该用户佣金交易明细
     * @param prizeuserid
     * @return
     */
    List<TdDistribution> queryByprizeuserid(int prizeuserid);

    /**
     * 根据抽佣用户ID查询累计佣金
     */
    Float queryByPrizeuseSumMoney(int prizeuserid);

    /**
     * 根据抽佣用户ID查询已结算佣金
     */
    Float queryByPrizeusePayMoney(int prizeuserid);


}